<?php
class Zend_View_Helper_BaseUrl extends Zend_View_Helper_Abstract
{
    public $view;
    
    public function baseUrl()
    {
        $url = sprintf('/%s/%s/%s', $this->view->request['module'], $this->view->request['controller'], $this->view->request['action']);
        foreach($this->view->request['par'] as $par => $pval)
            $url .= sprintf('/%s/%s', $par, $pval);
        if($this->view->filter) $url .= sprintf ('/sfilter/%s',urlencode($this->view->filter));
        return $url;
    }

    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}